<?php
set_time_limit(0);

$file_open = fopen("E:/BaiduNetdiskDownload/0224/ex-shutdown-2020-02-24-13.log","r");
$tmp = array();
$line_arr = array();

$file_path = "";
$line_count = "";

while (!feof($file_open)){
    $line = fgets($file_open);
    if(strpos($line,"[file]") !== false){
        $file_path = $line;
    }
    if(strpos($line,"[line]") !== false){
        if(!isset($line_arr[$file_path])){
            $line_arr[$file_path][] = $line;
        }else{
            if(!in_array($line,$line_arr[$file_path])){
                $line_arr[$file_path][] = $line;
            }
        }
    }
}

fclose($file_open);

print_r($line_arr);
die();
